home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-17 | 2.4 KB | 113 lines | [TEXT/CWIE] |
- // ===========================================================================
- // LCHandleStream.cp ©1993 Brian Todoroff All rights reserved.
- // Version 1.0b
- // ===========================================================================
- //
- // This class may only be distributed as part of the CGI++ Framework. For
- // further information contact the author at btodorof@hmc.edu.
- //
- // A subclass of LHandleStream that adds << operators for output. This version
- // includes special modifiers for HTML.
-
- #ifdef PowerPlant_PCH
- #include PowerPlant_PCH
- #endif
-
- #include "LCHandleStream.h"
-
-
- // ---------------------------------------------------------------------------
- // • LCHandleStream
- // ---------------------------------------------------------------------------
- // Default Constructor
-
- LCHandleStream::LCHandleStream()
- :LHandleStream()
- {
- }
-
-
- // ---------------------------------------------------------------------------
- // • LCHandleStream(Handle)
- // ---------------------------------------------------------------------------
- // Construct from an existing Handle
- //
- // The LHandleStream object assumes control of the Handle
-
- LCHandleStream::LCHandleStream(Handle inHandle)
- :LHandleStream(inHandle)
- {
- }
-
-
- // ---------------------------------------------------------------------------
- // • ~LCHandleStream
- // ---------------------------------------------------------------------------
- // Destructor
- LCHandleStream::~LCHandleStream()
- {
- }
-
-
-
- Int32 LCHandleStream::WriteCStr(const void *inString)
- {
- return LHandleStream::WriteData(inString,strlen((char *)inString));
- }
-
- LCHandleStream &LCHandleStream::operator<<(char *inStr)
- {
- WriteCStr(inStr);
- return *this;
- }
-
- LCHandleStream &LCHandleStream::operator<<(Handle inH)
- {
- HLock(inH);
- WriteData(*inH,GetHandleSize(inH));
- HUnlock(inH);
- return *this;
- }
-
- LCHandleStream &LCHandleStream::operator<<(char inChar)
- {
- WriteData(&inChar,1);
- return *this;
- }
-
- LCHandleStream &LCHandleStream::operator<<(int inInt)
- {
- char *t=new char[10];
- sprintf(t,"%d",inInt);
- WriteCStr(t);
- delete t;
- return *this;
- }
-
-
- LCHandleStream &endl(LCHandleStream &stream)
- {
- stream<<brkl<<crlf;
- return stream;
- }
-
- LCHandleStream &brkl(LCHandleStream &stream)
- {
- stream<<"<br>";
- return stream;
- }
-
- LCHandleStream &newl(LCHandleStream &stream)
- {
- stream<<(char)0x0D;
- return stream;
- }
-
- LCHandleStream &crlf(LCHandleStream &stream)
- {
- stream<<(char)0x0D<<(char)0x0A;
- return stream;
- }
-
-
-